package com.common.jump;

import android.content.Context;
import android.content.Intent;

import com.curry.android.util.IntentHelper;
import com.orangelife.mobile.annoucement.activity.AnnoucementDetailActivity;
import com.orangelife.mobile.annoucement.activity.AnnoucementListActivity;

/**
 * 小区公共和系统消息
 * Created by wgf on 2016/7/1.
 *
 * @author wgf
 * @since v3.8
 */
public class MessageJumper {

    /** 跳转到系统消息界面 */
    public static void jumpToMessageList(Context context) {
        jumpToMessageList(context, AnnoucementListActivity.TYPE_MESSAGE);
    }

    public static void jumpToAnnouncementList(Context context) {
        jumpToMessageList(context, AnnoucementListActivity.TYPE_ANNOUNCEMENT);
    }

    public static void jumpToAnnouncementDetail(Context context, String url, String annoID, boolean isMore, String isRead) {
        Intent intent = new Intent();
        intent.putExtra("url", url);
        intent.putExtra("annoID", annoID);
        intent.putExtra("isMore", isMore);
        intent.putExtra("isRead", isRead);
        intent.setClass(context, AnnoucementDetailActivity.class);
        context.startActivity(intent);
    }


    /**
     * @param context
     * @param type    1=系统消息，2=小区公告；
     */
    public static void jumpToMessageList(Context context, String type) {
        IntentHelper.getInstances().intentWithExtraString(context, AnnoucementListActivity.class, "type", type);
    }

}
